<!-- 设备缺陷记录 sbqxjlList.jsp -->
<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="frm.ssh.util.page.SearchBean"%>
<%@ include file="/jsp/common/common.jsp"%>

<%
	String roles = (String) session.getAttribute(IConstant.SESSION_ROLES);
	//只有设计院可以新建
	boolean canAddNew = false;
	if(roles.contains("tabl_sjy"))
		canAddNew = true;
%>
<html>
	<head>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script language="javascript" src="<%=contextPath%>/js/sorttable.js"type=""></script>
		<link rel="stylesheet" type="text/css"	href="<%=contextPath%>/css/sorttable.css">
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/jquery.form.js"></script>
		<script>
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '查询',
				            icon:"<%=contextPath%>/images/query.gif",
				            handler:cmt
				        },'-', 
				       
				        {
				            text: '清空',
				            icon:"<%=contextPath%>/images/clear.png",
				            handler:resetForm
				        },'-', 
				      	
				        {
				        	text: '新建',
				        	icon:"<%=contextPath%>/images/add.gif",
				        	hidden:<%=canAddNew || "1".equals(session.getAttribute("SESSION_ISADMIN"))? false:true %>,
				        	handler:function() {
						            	toDetail('0')
						            }
				        },'->',
				        {
				            text: '查询条件',
				            icon:"<%=contextPath%>/images/down_bottom.gif",
				            handler:displayquerydiv
				        }
				        
			    	]
			    });
			});
		</script>
	</head>
	<body>
		<div id ='tbar'></div>
		<br>
		<div id="Layer" style="position:absolute;display:block left:0px; top:35px; width:100%; height:94%; z-index:1000; overflow:auto;">
		
		<form id="frmM" name="frmM" method="POST" action="<%=contextPath%>/queryUser.do">
			<input type="hidden" name="searchBean.displayFlag" value="${searchBean.displayFlag}"/>
			<table width="100%" id="contab">
				<tbody id="querydiv">
				<tr>
					<th>
						开始日期：
					</th>
					<td>
						<input type="text" size="12" readonly="true" name="searchBean.con2"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2'),maxDate:'#F{$dp.$D(\'searchBean.con3\')}'})" id="searchBean.con2" value="${searchBean.con2}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2'),maxDate:'#F{$dp.$D(\'searchBean.con3\')}'})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
						&nbsp;
						~
						&nbsp;
						<input type="text" size="12" readonly="true" name="searchBean.con3"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3'),minDate:'#F{$dp.$D(\'searchBean.con2\')}'})" id="searchBean.con3" value="${searchBean.con3}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3'),minDate:'#F{$dp.$D(\'searchBean.con2\')}'})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
					<th>
						状态：
					</th>
					<td>
						<s:select list="statusList" emptyOption="true" name="searchBean.con4" width="300" listKey="sid" listValue="name"/>
					</td>
					
				</tr>
				</tbody>
			</table>
			
			<hr>
			<table width="100%" id="listtab">
			<thead>
				<tr>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="60">序号</td>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="110">变电站编号</td>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="110">变电站名称</td>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="80">开始日期</td>					
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="150">当前状态</td>
				</tr>
				</thead>
				<c:forEach items="${list}" var="detail" varStatus="status">
					<tr  ondblclick="javascript:toDetail('<c:out value="${detail.id}"/>')">
						<td width="20"> 
							<a href="#" onClick="javascript:toDetail('<c:out value="${detail.id}"/>')" >${status.index+1}</a>
					 	</td>
						<td width="110">
							<c:out value="${detail.bdzid}"/>
						</td>
						<td width="60">&nbsp;<c:out value="${detail.bdzname}"/></td>
						<td width="110" >
							&nbsp;<c:out value="${detail.startdate}"/>
						</td>				
						<td width="270">
							<c:choose>
								<c:when test="${detail.status == '01'}">监控信息收集整理</c:when>
								<c:when test="${detail.status == '02'}">监控信息填报</c:when>
								<c:when test="${detail.status == '03'}">监控信息审定</c:when>
								<c:when test="${detail.status == '04'}">审定驳回</c:when>
								<c:when test="${detail.status == '05'}">设备安装调试验收</c:when>
								<c:when test="${detail.status == '06'}">监控信息核对</c:when>
								<c:when test="${detail.status == '07'}">修改监控系统</c:when>
								<c:when test="${detail.status == '08'}">问题确认</c:when>
								<c:when test="${detail.status == '09'}">监控信息修改</c:when>
								<c:when test="${detail.status == '10'}">监控信息修改审定 </c:when>
								<c:when test="${detail.status == '11'}">材料存档</c:when>
								<c:when test="${detail.status == '12'}">归档完成</c:when>
							</c:choose>
						</td>
					</tr>
				</c:forEach>
				
				<c:if test="${list == null || fn:length(list) == 0 }">
					<tr>
						<td colspan="10" style="text-align: center">
							无相关记录
						</td>
					</tr>
				</c:if>
			</table>
			<table width="100%" id="tablestyle2">
				<tr>
					<td>
						<hr />
					</td>
				</tr>
				<tr>
					<td>${pageDown}</td>
				</tr>
			</table>
		</form>
		<iframe id="ifrDownLoad" style="display:none" src=""></iframe>	
		</div>
	</body>
</html>
<script type="text/javascript">
	var st = new SortableTable(document.getElementById("listtab"),["None","String","String","String","String"]);
</script>
<script language="javascript">

			// 查询
			function cmt(){
				document.frmM.action = "<%=contextPath%>/tablJkList!getList.do?page=1";
				document.frmM.submit();
			}

			// 新建修改进入详细页面
			function toDetail(id){
				parent.addTab("变电站监控信息管理", "<%=contextPath%>/tablJk!initTablJkDetail.do?id="+id,id);
			}

			// 删除
			function deleteIt()
			{
				if(!isChecked("id")) {
		 			alert("请选择要删除的记录");
		 			return false;
		 		}
		    	if(confirm("确定要删除选中的记录吗？")) {
		        	document.frmM.action = "<%=contextPath%>/sbqxjl!delete.do?searchBean.con15=";
					document.frmM.submit();
		    	}
			}
			
		</script>